import 'package:du_application/model/IndexModel.dart';

class ListModel {
  int errno;
  Data data;
  String errmsg;

  ListModel({this.errno, this.data, this.errmsg});

  ListModel.fromJson(Map<String, dynamic> json) {
    errno = json['errno'];
    data = json['data'] != null ? new Data.fromJson(json['data']) : null;
    errmsg = json['errmsg'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['errno'] = this.errno;
    if (this.data != null) {
      data['data'] = this.data.toJson();
    }
    data['errmsg'] = this.errmsg;
    return data;
  }
}

class Data {
  int total;
  int pages;
  List<GoodsList> firstList;
  int limit;
  int page;

  Data({this.total, this.pages, this.firstList, this.limit, this.page});

  Data.fromJson(Map<String, dynamic> json) {
    total = json['total'];
    pages = json['pages'];
    if (json['firstList'] != null) {
      firstList = new List<GoodsList>();
      json['firstList'].forEach((v) {
        firstList.add(new GoodsList.fromJson(v));
      });
    }
    limit = json['limit'];
    page = json['page'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['total'] = this.total;
    data['pages'] = this.pages;
    if (this.firstList != null) {
      data['firstList'] = this.firstList.map((v) => v.toJson()).toList();
    }
    data['limit'] = this.limit;
    data['page'] = this.page;
    return data;
  }
}


